(0) Obligation:
JBC Problem based on JBC Program:
Manifest-Version: 1.0
Created-By: 1.6.0_26 (Sun Microsystems Inc.)
Main-Class: simple/alternatingIncr/Main
package simple.alternatingIncr;
public class AlternatingIncr {
public static void increase(int i) {
while (i > 0) {
if (i % 2 == 0) {
i--;
} else {
i = i+3;
}
}
}
}
package simple.alternatingIncr;
public class Main {
/**
* @param args
*/
public static void main(String[] args) {
AlternatingIncr.increase(args.length);
}
}
(1) JBCNonTerm (EQUIVALENT transformation)
Reached a loop using the following run:
0:
<simple.alternatingIncr.Main.main||0: load ADDR args||args: a52|| ->
String.serialVersionUID: -6849794470754667710L
String.serialPersistentFields: a50
String.CASE_INSENSITIVE_ORDER: o26
String$CaseInsensitiveComparator.serialVersionUID: 8575799808933029326L
RuntimeException.serialVersionUID: -7034897190745766939L
Exception.serialVersionUID: -3387516993124229948L
Throwable.serialVersionUID: -3042686055658047285L
o26!: String$CaseInsensitiveComparator()
a50([java.io.ObjectStreamField|]): length 0
a52([java.lang.String...]): length 2
1:
<simple.alternatingIncr.Main.main||1: arraylength|| - ||a52>
String.serialVersionUID: -6849794470754667710L
String.serialPersistentFields: a50
String.CASE_INSENSITIVE_ORDER: o26
String$CaseInsensitiveComparator.serialVersionUID: 8575799808933029326L
RuntimeException.serialVersionUID: -7034897190745766939L
Exception.serialVersionUID: -3387516993124229948L
Throwable.serialVersionUID: -3042686055658047285L
o26!: String$CaseInsensitiveComparator()
a50([java.io.ObjectStreamField|]): length 0
a52([java.lang.String...]): length 2
2:
<simple.alternatingIncr.Main.main||2: simple.alternatingIncr.AlternatingIncr.increase(I)V|| - ||2>
String.serialVersionUID: -6849794470754667710L
String.serialPersistentFields: a50
String.CASE_INSENSITIVE_ORDER: o26
String$CaseInsensitiveComparator.serialVersionUID: 8575799808933029326L
RuntimeException.serialVersionUID: -7034897190745766939L
Exception.serialVersionUID: -3387516993124229948L
Throwable.serialVersionUID: -3042686055658047285L
o26!: String$CaseInsensitiveComparator()
a50([java.io.ObjectStreamField|]): length 0
a52([java.lang.String...]): length 2
3:
<simple.alternatingIncr.AlternatingIncr.increase||0: load INT i||i: 2|| ->
<simple.alternatingIncr.Main.main||2: simple.alternatingIncr.AlternatingIncr.increase|| - ||2>
String.serialVersionUID: -6849794470754667710L
String.serialPersistentFields: a50
String.CASE_INSENSITIVE_ORDER: o26
String$CaseInsensitiveComparator.serialVersionUID: 8575799808933029326L
RuntimeException.serialVersionUID: -7034897190745766939L
Exception.serialVersionUID: -3387516993124229948L
Throwable.serialVersionUID: -3042686055658047285L
o26!: String$CaseInsensitiveComparator()
a50([java.io.ObjectStreamField|]): length 0
a52([java.lang.String...]): length 2
In the loop head node, references [i12, iconst_0] were interesting.
By SMT, we could prove
((0 <= initial_i12 and 0 <= initial_i11) and ((((path1_i12 = path1_i21 and path1_i24 = (path1_i21 % 2) and path1_i27 = (path1_i21 + -1) and path1_i27 = res_i12 and path1_i11 = res_i11 and path1_i12 = initial_i12 and path1_i11 = initial_i11) and (path1_i21 > 0 and path1_i24 = 0 and T)) or ((path2_i12 = path2_i21 and path2_i24 = (path2_i21 % 2) and path2_i31 = (path2_i21 + 3) and path2_i31 = res_i12 and path2_i11 = res_i11 and path2_i12 = initial_i12 and path2_i11 = initial_i11) and (path2_i21 > 0 and path2_i24 = 1 and 1 > 0))) and (((res_i12 = res_i21 and res_i24 = (res_i21 % 2) and res_i27 = (res_i21 + -1)) and !(res_i21 > 0 and res_i24 = 0 and T)) and ((res_i12 = res_i21 and res_i24 = (res_i21 % 2) and res_i31 = (res_i21 + 3)) and !(res_i21 > 0 and res_i24 = 1 and 1 > 0)))))
to be UNSAT. Consequently, the loop will not terminate.